package come.bit.demo1.Demo3;
//Animal.java
class Animal {
    public String name;
    public Animal(String name) {
        this.name = name;
    }
    public void eat() {
        System.out.println(this.name + "正在吃东西");
    }
}
//Dog.java
class Dog extends Animal   {
    public Dog(String name) {
        super(name);
    }
//Bird.java
class Bird extends Animal  {
        public Bird(String name) {
            super(name);
        }
        public void fly() {
            System.out.println(this.name + "正在fly");
        }
    }
}
public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog("小黑");
        dog.eat();





    }
}


